#使用eval结合requests发请求
import requests
url='http://www.baidu.com'
# res=requests.get(url)  #写法1
# print(res.text)
method='get'
# send=eval(f"requests.{method}('{url}')")
# print(send)
send = f"requests.{method}('{url}')"
print([send])
res=eval(send)
print(res.text)